package com.zeng.stpro.commons.controller;

import com.zeng.stpro.commons.exception.IpNotAllowedException;
import com.zeng.stpro.commons.utils.R;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author ZENGZHIJUN
 * @Date 2021/2/7 13:20
 */

@RestController
@RequestMapping("error")
public class UnifyErrorController extends AbstractBaseController {

    @RequestMapping("/ipNotAllowedException")
    public R ipNotAllowedException() {
        throw new IpNotAllowedException(HttpStatus.FORBIDDEN.value(), "当前 IP 没有权限访问！");
    }
}
